<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>优雅登录注册页面</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: #f5f5f5;
            color: #333;
            overflow-x: hidden;
        }

        .container {
            display: flex;
            min-height: 100vh;
            position: relative;
        }

        /* 左侧品牌展示区 */
        .brand-section {
            flex: 1;
            background: linear-gradient(135deg, #6e8efb, #a777e3);
            color: white;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 2rem;
            position: relative;
            overflow: hidden;
        }

        .brand-content {
            z-index: 2;
            max-width: 500px;
            text-align: center;
            opacity: 0;
            transform: translateX(-50px);
        }

        .brand-section h1 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            font-weight: 700;
        }

        .brand-section p {
            font-size: 1.1rem;
            line-height: 1.6;
            margin-bottom: 2rem;
            opacity: 0.9;
        }

        .brand-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: url('https://images.unsplash.com/photo-1516321318423-f06f85e504b3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80') center/cover;
            opacity: 0.2;
            z-index: 1;
        }

        .brand-decoration {
            position: absolute;
            width: 300px;
            height: 300px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            z-index: 1;
        }

        .decoration-1 {
            top: -100px;
            right: -100px;
            width: 400px;
            height: 400px;
        }

        .decoration-2 {
            bottom: -50px;
            left: -50px;
        }

        /* 右侧表单区 */
        .form-section {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 2rem;
            background: white;
        }

        .form-container {
            max-width: 400px;
            width: 100%;
            opacity: 0;
            transform: translateX(50px);
        }

        .form-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .form-header h2 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
            color: #333;
        }

        .form-header p {
            color: #666;
        }

        .tabs {
            display: flex;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid #eee;
        }

        .tab {
            flex: 1;
            text-align: center;
            padding: 0.75rem;
            cursor: pointer;
            color: #666;
            font-weight: 500;
            transition: all 0.3s ease;
            position: relative;
        }

        .tab.active {
            color: #6e8efb;
        }

        .tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 100%;
            height: 2px;
            background: #6e8efb;
        }

        .form {
            display: none;
        }

        .form.active {
            display: block;
        }

        .form-group {
            margin-bottom: 1.5rem;
            position: relative;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: #555;
        }

        .form-control {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .form-control:focus {
            border-color: #6e8efb;
            box-shadow: 0 0 0 2px rgba(110, 142, 251, 0.2);
            outline: none;
        }

        .remember-forgot {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .remember-me {
            display: flex;
            align-items: center;
        }

        .remember-me input {
            margin-right: 0.5rem;
        }

        .forgot-password {
            color: #6e8efb;
            text-decoration: none;
            font-size: 0.9rem;
        }

        .forgot-password:hover {
            text-decoration: underline;
        }

        .btn {
            width: 100%;
            padding: 0.75rem;
            border: none;
            border-radius: 4px;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-primary {
            background: #6e8efb;
            color: white;
        }

        .btn-primary:hover {
            background: #5a7df4;
        }

        .social-login {
            margin-top: 2rem;
            text-align: center;
        }

        .social-login p {
            color: #666;
            margin-bottom: 1rem;
            position: relative;
        }

        .social-login p::before,
        .social-login p::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 30%;
            height: 1px;
            background: #eee;
        }

        .social-login p::before {
            left: 0;
        }

        .social-login p::after {
            right: 0;
        }

        .social-icons {
            display: flex;
            justify-content: center;
            gap: 1rem;
        }

        .social-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f5f5f5;
            color: #666;
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .social-icon:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .social-icon i {
            font-size: 1.2rem;
        }

        .facebook { color: #3b5998; }
        .twitter { color: #1da1f2; }
        .google { color: #db4437; }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                flex-direction: column;
            }

            .brand-section {
                padding: 2rem 1rem;
                min-height: 300px;
            }

            .form-section {
                padding: 2rem 1rem;
            }
        }
    </style>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
</head>
<body>
<div class="container">
    <!-- 左侧品牌展示区 -->
    <div class="brand-section">
        <div class="brand-decoration decoration-1"></div>
        <div class="brand-decoration decoration-2"></div>
        <div class="brand-bg"></div>
        <div class="brand-content">
            <h1>欢迎回来</h1>
            <p>加入我们的社区，探索无限可能。无论您是第一次访问还是老用户，我们都为您准备了精彩的体验。</p>
        </div>
    </div>

    <!-- 右侧表单区 -->
    <div class="form-section">
        <div class="form-container">
            <div class="form-header">
                <h2>欢迎登录</h2>
                <p>请使用您的账号登录或注册新账号</p>
            </div>

            <div class="tabs">
                <div class="tab active" data-tab="login">登录</div>
                <div class="tab" data-tab="register">注册</div>
            </div>

            <!-- 登录表单 -->
            <form id="login-form" class="form active">
                <div class="form-group">
                    <label for="login-email">电子邮箱</label>
                    <input type="email" id="login-email" class="form-control" placeholder="请输入您的邮箱" required>
                </div>
                <div class="form-group">
                    <label for="login-password">密码</label>
                    <input type="password" id="login-password" class="form-control" placeholder="请输入您的密码" required>
                </div>
                <div class="remember-forgot">
                    <div class="remember-me">
                        <input type="checkbox" id="remember-me">
                        <label for="remember-me">记住我</label>
                    </div>
                    <a href="#" class="forgot-password">忘记密码?</a>
                </div>
                <button type="submit" class="btn btn-primary">登录</button>

                <div class="social-login">
                    <p>或使用社交账号登录</p>
                    <div class="social-icons">
                        <a href="#" class="social-icon facebook"><i class="fab fa-facebook-f"></i></a>
                        <a href="#" class="social-icon twitter"><i class="fab fa-twitter"></i></a>
                        <a href="#" class="social-icon google"><i class="fab fa-google"></i></a>
                    </div>
                </div>
            </form>

            <!-- 注册表单 -->
            <form id="register-form" class="form">
                <div class="form-group">
                    <label for="register-name">用户名</label>
                    <input type="text" id="register-name" class="form-control" placeholder="请输入您的用户名" required>
                </div>
                <div class="form-group">
                    <label for="register-email">电子邮箱</label>
                    <input type="email" id="register-email" class="form-control" placeholder="请输入您的邮箱" required>
                </div>
                <div class="form-group">
                    <label for="register-password">密码</label>
                    <input type="password" id="register-password" class="form-control" placeholder="请输入您的密码" required>
                </div>
                <div class="form-group">
                    <label for="register-confirm-password">确认密码</label>
                    <input type="password" id="register-confirm-password" class="form-control" placeholder="请再次输入密码" required>
                </div>
                <button type="submit" class="btn btn-primary">注册</button>
            </form>
        </div>
    </div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/gsap.min.js"></script>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        // 初始化动画
        gsap.to('.brand-content', {
            opacity: 1,
            x: 0,
            duration: 1,
            ease: 'power3.out'
        });

        gsap.to('.form-container', {
            opacity: 1,
            x: 0,
            duration: 1,
            ease: 'power3.out',
            delay: 0.3
        });

        // 背景装饰动画
        gsap.to('.decoration-1', {
            x: 50,
            y: 50,
            duration: 10,
            repeat: -1,
            yoyo: true,
            ease: 'sine.inOut'
        });

        gsap.to('.decoration-2', {
            x: -30,
            y: -30,
            duration: 8,
            repeat: -1,
            yoyo: true,
            ease: 'sine.inOut',
            delay: 1
        });

        // 切换标签
        const tabs = document.querySelectorAll('.tab');
        const forms = document.querySelectorAll('.form');

        tabs.forEach(tab => {
            tab.addEventListener('click', function() {
                // 更新活动标签
                tabs.forEach(t => t.classList.remove('active'));
                this.classList.add('active');

                // 显示对应表单
                const tabName = this.getAttribute('data-tab');
                forms.forEach(form => {
                    form.classList.remove('active');
                    if (form.id === `${tabName}-form`) {
                        form.classList.add('active');

                        // 添加表单显示动画
                        gsap.fromTo(form,
                            { opacity: 0, y: 20 },
                            { opacity: 1, y: 0, duration: 0.5, ease: 'power2.out' }
                        );
                    }
                });
            });
        });

        // 表单提交处理
        document.getElementById('login-form').addEventListener('submit', function(e) {
            e.preventDefault();
            const email = document.getElementById('login-email').value;
            const password = document.getElementById('login-password').value;
            const rememberMe = document.getElementById('remember-me').checked;

            console.log('登录提交:', { email, password, rememberMe });

            // 这里添加实际的登录逻辑
            alert('登录功能演示 - 实际应用中这里会处理登录逻辑');
        });

        document.getElementById('register-form').addEventListener('submit', function(e) {
            e.preventDefault();
            const name = document.getElementById('register-name').value;
            const email = document.getElementById('register-email').value;
            const password = document.getElementById('register-password').value;
            const confirmPassword = document.getElementById('register-confirm-password').value;

            if (password !== confirmPassword) {
                alert('两次输入的密码不一致');
                return;
            }

            console.log('注册提交:', { name, email, password });

            // 这里添加实际的注册逻辑
            alert('注册功能演示 - 实际应用中这里会处理注册逻辑');
        });

        // 忘记密码点击
        document.querySelector('.forgot-password').addEventListener('click', function(e) {
            e.preventDefault();
            alert('忘记密码功能演示 - 实际应用中这里会发送密码重置邮件');
        });
    });
</script>
</body>
</html>